package com.tyrone.leetcode.weekgame;

/**
 * @author yelong.xie
 * @date 2024/1/21 10:48
 */
public class MinimumPushesSecond {
    public static void main(String[] args) {
        System.out.println(MinimumPushesSecond.minimumPushes("amrvxnhsewkoipjyuclgtdbfq"));
    }

    public static int minimumPushes(String word) {
        int n = word.length();
        int[] arr = new int[27];
        for (int i = 0; i < word.length(); i++) {
            arr[word.charAt(i)-'a'+1]++;
        }
        int diff = 0;
        for (int i : arr) {
            if (i!=0) diff++;
        }
        if (n <= 8) return n;
        else if (n > 8 && n <= 16) return 8 + (n - 8) * 2;
        else if (n > 16 && n <= 24) return 24 + (n - 16) * 3;
        else return 48 + (n - 24) * 4;
    }
}
